import { useCallback, useMemo, useState } from "react";

import "./App.css";
import { useDebounce } from "./hooks/useDebounce";

function App() {

  useMemo

  useCallback

  
  const [count, setCount] = useState(0);
  // 没有防抖
  const handleClick = () => setCount(count + 1);
  // 防抖函数  自定义hooks
  const handleClickDebounce = useDebounce(handleClick);
  return (
    <>
      <h1>{count}</h1>
      <button onClick={handleClick}> +1</button>
      <button onClick={handleClickDebounce}> +1</button>
    </>
  );
}

export default App;
